/**
 * Copyright 2010 Tristan Slominski
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.mindash.handlebars.client;

import com.google.gwt.inject.client.AbstractGinModule;
import com.google.inject.Singleton;
import com.mindash.handlebars.client.pages.utils.Redirect;
import com.mindash.handlebars.client.pages.utils.impl.RedirectImpl;
import com.mindash.handlebars.client.services.EventBus;
import com.mindash.handlebars.client.services.PlaceService;
import com.mindash.handlebars.client.services.RpcService;
import com.mindash.handlebars.client.services.impl.DefaultRpcServiceImpl;
import com.mindash.handlebars.client.services.impl.QueueingEventBusImpl;
import com.mindash.handlebars.client.services.impl.StarterProjectPlaceServiceImpl;
import com.mindash.handlebars.client.services.utils.PlaceServiceUtils;
import com.mindash.handlebars.client.services.utils.impl.PlaceServiceUtilsImpl;
import com.mindash.handlebars.client.wrappers.HistoryWrapper;
import com.mindash.handlebars.client.wrappers.RootPanelWrapper;
import com.mindash.handlebars.client.wrappers.impl.HistoryWrapperImpl;
import com.mindash.handlebars.client.wrappers.impl.RootPanelWrapperImpl;

/**
 * @author Tristan Slominski
 * 
 */
public class HandlebarsClientModule extends AbstractGinModule {

  @Override
  protected void configure() {

    bind(HandlebarsGinjector.class).in(Singleton.class);

    // application services
    bind(EventBus.class).to(QueueingEventBusImpl.class).in(Singleton.class);
    bind(PlaceService.class).to(StarterProjectPlaceServiceImpl.class).in(
        Singleton.class);
    bind(Redirect.class).to(RedirectImpl.class).in(Singleton.class);
    bind(RpcService.class).to(DefaultRpcServiceImpl.class).in(Singleton.class);

    // other bindings
    bind(HistoryWrapper.class).to(HistoryWrapperImpl.class).in(Singleton.class);
    bind(PlaceServiceUtils.class).to(PlaceServiceUtilsImpl.class).in(
        Singleton.class);
    bind(RootPanelWrapper.class).to(RootPanelWrapperImpl.class).in(
        Singleton.class);
  }

}
